package com.hoshino.momochi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hoshino.momochi.model.domain.Focus;
import com.hoshino.momochi.model.domain.UserDetails;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FocusMapper extends BaseMapper<Focus> {

    /**
     * 自己 添加关注一定是 关注方
     *
     * @param focus local_id,focus_id,create_time
     */
    void addFocus(Focus focus);

    /**
     * 根据 用户id 获取 粉丝列表
     *
     * @param focus local_id
     * @return
     */
    List<Long> getFocus(Focus focus);

    /**
     * 根据 用户 id 获取 关注列表
     *
     * @param focus focus_id
     * @return
     */
    List<Long> getLocal(Focus focus);

    /**
     * 取消关注 那么 也一定是作为 关注者 取消
     *
     * @param focus local_id,focus_id
     */
    void delFocus(Focus focus);

    /**
     * 获取 粉丝的详细信息
     *
     * @param focus
     * @return
     */
    List<Focus> getFocusUserDetails(Focus focus);

    /**
     * 获取 关注的人的详细信息
     *
     * @param focus
     * @return
     */
    List<Focus> getLocalUserDetails(Focus focus);

    /**
     * 判断 当前用户是否关注了 lid 用户
     *
     * @param uid
     * @param lid
     * @return
     */
    Long getLocalUserByUserId(Long uid, Long lid);

    /**
     * 删除 isDelete = 1 的数据
     */
    void delIsDeleteAsTrue();
}
